package com.xncoding.design.ZeRenLian.demo2;

public class Cliect {
    public static void main(String[] args) {
        HandlerChainSum00 handlerChain = new HandlerChainSum00();
        Handler handler00 = new Handler00();
        Handler handler01 = new Handler01();
        Handler handler02 = new Handler02();

        handlerChain.addHandler(handler00);
        handlerChain.addHandler(handler02);
        handlerChain.addHandler(handler01);

        RequestSource requestSource = new RequestSource();
        requestSource.setHeader(1);
        requestSource.setBody(2);
        requestSource.setFooter(3);

        handlerChain.doChain(requestSource);
    }
}
